// # -*- mode: c++ -*-
#pragma once
#include <ttl/bits/idx_encoding.hpp>
#include <ttl/bits/raw_tensor.hpp>
#include <ttl/bits/std_host_allocator.hpp>
#include <ttl/bits/type_encoder.hpp>

namespace ttl
{
namespace experimental
{
using idx_encoder =
    internal::basic_type_encoder<internal::idx_format::encoding>;

using raw_tensor = internal::raw_tensor<idx_encoder, internal::host_memory>;

using raw_tensor_ref =
    internal::raw_tensor_ref<idx_encoder, internal::host_memory>;

using raw_tensor_view =
    internal::raw_tensor_view<idx_encoder, internal::host_memory>;

template <typename R, typename S, typename D, typename A>
raw_tensor_ref raw_ref(const internal::basic_tensor<R, S, D, A> &t)
{
    using ref_t = internal::basic_tensor<R, S, D, internal::readwrite>;
    return raw_tensor_ref(ref_t(t));
}

template <typename R, typename S, typename D, typename A>
raw_tensor_view raw_view(const internal::basic_tensor<R, S, D, A> &t)
{
    using view_t = internal::basic_tensor<R, S, D, internal::readonly>;
    return raw_tensor_view(view_t(t));
}
}  // namespace experimental
}  // namespace ttl
